<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            padding: 50px;
            width: 300px;
            height: 300px;
            background-color: bisque;
            border: 20px solid red;
        }
    </style>
</head>
<body>
    <div class="box">

    </div>
    <script>
        var divEle = document.querySelector(".box");
        divEle.onclick = function ( event ) {
            var e = event || window.event ; 
            console.log(e.offsetX);
            console.log(e.offsetY);
        }
    </script>
</body>
</html>